package com.itheima2;

import java.util.ArrayList;
import java.util.Iterator;

public class Work3 {
    public static void main(String[] args) {
        ArrayList<String> list = new ArrayList<>();
        list.add("hehe");
        list.add("haha");
        list.add("heihei");
        list.add("gege");
        list.add("gaga");
        Iterator<String> iterator = list.iterator();
        while (iterator.hasNext()){
            System.out.println(iterator.next());
        }
    }
}
